home *** CD-ROM | disk | FTP | other *** search
/ CD Ware Multimedia 1994 November / Cd Ware (Nro. 2) - Epimundo.iso / DOS / CM / GP25.ZIP / MSGWIN.DOC < prev    next >
Encoding:
Text File  |  1993-05-06  |  5.2 KB  |  122 lines

  1. ____________________________________________________________________________
  2. MSGWIN()    -    General purpose dialog display box.
  3.  
  4.  
  5. Purpose
  6.  
  7.     The purpose of this procedure is to display a pop-up display for a message.
  8.  
  9. Syntax
  10.  
  11.     MsgWin(<C_Message> [, <xParam2>, <C_Buttons>, <C_ReadOptions> 
  12.             , <cHelpObj> ])
  13.     
  14.         C_Message is the message to display.  This message may be any length, the window will auto-size itself to display the message.  Any ~ (tilde) characters are translated to a {cr}{lf}.
  15.  
  16.         xParam2.  If xParam2 is not passed or is .F., then the window will be in the DIALOG color scheme.  If xParam2 is .T. then the window will be in ALERT color scheme.  If xParam2 is a character string then the character string is used as the window title.  If the first character is a !, then the window will be ALERT color scheme, and the ! will be removed.  The window title will be the remainder of the string.  If cHelpObj is not passed, then it will default to (strtran(alltrim(xParam2),' ','_')).  I.E. all trailing and leading spaces will be removed, and remaining spaces will be converted to under-scores.
  17.  
  18.         C_Buttons are the optional buttons to use for the dialog box.  The buttons must be separated by a semi-colon (;).  If no buttons are passed, the program defaults to one button (< OK >).  By default the first letter of each button is activated as a hot-key.  You can override this behavior by specifying your own hot key (\<).  If the button string starts with a semi-colon, or the buttons are too wide to fit on the screen horizontally, the buttons will be displayed vertically.
  19.  
  20.         C_ReadOptions is an optional clause to be added to the READ clause of the message window.  You can use this option to implement valid clauses, WITH clauses, etc.
  21.  
  22.         cHelpObj is an optional Help Object specifier for use with CALLHELP.PRG and HELPEDIT.PRG.  If this object is not passed, and there is a title passed in xParam2, then the object will default to the window title.
  23.  
  24.  
  25. Returns
  26.  
  27.     Upper(), Alltrim() of the Button selected.  If escape was pressed, MsgWin() returns a null string, or the text of the default escape button if specified(\!).
  28.  
  29. Notes
  30.  
  31.     The internal read variable is named nChoice.  You can reference this variable during any read valid clauses you wish to specify.  For information on the button activation/formatting commands, refer to the help for @SAY PUSH BUTTONS in the FoxPro Help file.
  32.  
  33.     
  34. ╓─────────────────────────────────╖
  35. ║             Examples            ║
  36. ╙─────────────────────────────────╜
  37.     
  38.  
  39. =MsgWin(' Some sort of message ~~The rest on line 2')
  40.  
  41. =MsgWin(' Some sort of message ~~The rest on line 2',.t.)
  42. && In alert color scheme
  43.  
  44. Choice=Msgwin('Do you wish to MODIFY file, ERASE file or COPY file.',.f.,'MODIFY;ERASE;COPY')
  45. * choice now contains the button selected.
  46. do case
  47. case choice='MODIFY'
  48.     *  modify the file
  49. case choice='ERASE'
  50.     *  erase the file
  51. case choice='COPY'
  52.     *  copy the file
  53. endcase
  54.  
  55. Choice=Msgwin('Do you wish to MODIFY file, ERASE file or COPY file.',.f.,';\!MODIFY;ERASE;C\<OPY;\?CANCEL')
  56.  
  57. *  The final demonstration shows how to use a Valid clause
  58.  
  59. result=msgwin('No floppy disk was inserted would you '+;'
  60.     'like to retry or cancel?',.t.,'Retry;Cancel','valid ISDISKIN('A') OR NCHOICE=2')
  61.  
  62.  
  63. ───────────────────────────────────
  64.  
  65. See Also: Yes()
  66.  
  67. ───────────────────────────────────
  68.  
  69. ____________________________________________________________________________
  70. YES()    -    General purpose OK/Cancel Dialog function
  71.  
  72. Purpose
  73.  
  74.     The purpose of this function is to display a message in a window, and get either OK or CANCEL from the user.
  75.  
  76. Syntax
  77.  
  78.     YES( <C_Message> [, <L_AlertMode>, cRdOptions ] )
  79.     
  80.         C_Message 
  81.         
  82.             Message to display.  This message may be any length, the window will auto-size itself to display the message.  Any ~ (tilde) charachters are translated to a {cr}{lf}.
  83.  
  84.         X_Param2
  85.         
  86.             If this variable is not passed, then the window will be DIALOG color scheme.  If the variable is passed and it is logical, the window will be DIALOG color scheme if false, and ALERT color scheme if true.
  87.  
  88.             If the variable passed is a character, the window will be DIALOG color scheme UNLESS the first character is an exclamation point (!).  If the first character is an exclamation point, it will be ALERT color scheme, and the leading exclamation point will be removed.
  89.  
  90.         C_ReadOptions 
  91.         
  92.             Optional clause to be added to the READ clause of the message window.  You can use this option to implement valid clauses, WITH clauses, etc.
  93.  
  94. Returns
  95.  
  96.     .T. if user selects OK, .F. otherwise
  97.  
  98. Notes
  99.  
  100.     The internal read variable is named nChoice.  You can reference this variable during any read valid clauses you wish to specify.  This function is actually a wrapper around the MSGWIN() function.
  101.  
  102.         
  103. ╓─────────────────────────────────╖
  104. ║             Examples            ║
  105. ╙─────────────────────────────────╜
  106.     
  107.  
  108. && Activate pop up window with 'ok/cancel push buttons, and msg displayed
  109.  
  110. if yes('Are you sure you want to do this?')  && Window is Dialog Color
  111.     do Dangerous_thing
  112. endif
  113.                           
  114. if yes('Are you sure you want to do this?',.t.)  && Window is Alert Color
  115.     do Dangerous_thing
  116. endif
  117.  
  118. ───────────────────────────────────
  119.  
  120. See Also: MsgWin()
  121.  
  122. ───────────────────────────────────